﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Site.master" AutoEventWireup="true"
    CodeFile="MyConsultation.aspx.cs" Inherits="Profile_MyConsultation" %>

<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="Server">
    <h2>
        我的咨询</h2>
    <div class="searchcondition"><span class="marginleft">姓名</span><asp:TextBox runat="server" ID="CustomerName">
        </asp:TextBox><span class="marginleft">电话</span><asp:TextBox ID="Telephone" runat="server"></asp:TextBox><span class="marginleft">业务类型</span><asp:DropDownList
            ID="DelegateType" runat="server" AppendDataBoundItems="True">
            <asp:ListItem Value="999">--请选择--</asp:ListItem>
        </asp:DropDownList>
        <asp:Button ID="Button1" runat="server" Text="查询" CssClass="marginleft"/>
    </div>
    <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" DataKeyNames="ConsultationID"
        DataSourceID="SqlDataSource1" OnRowCommand="Consultation_RowCommand" CssClass="commongv">
        <Columns>
            <asp:BoundField DataField="ConsultationID" HeaderText="ConsultationID" InsertVisible="False"
                ReadOnly="True" SortExpression="ConsultationID" Visible="False" />
            <asp:BoundField DataField="姓名" HeaderText="姓名" SortExpression="姓名" />
            <asp:BoundField DataField="咨询时间" HeaderText="咨询时间" SortExpression="咨询时间" DataFormatString="{0:yyyy-MM-dd}"/>
            <asp:BoundField DataField="咨询业务" HeaderText="咨询业务" SortExpression="咨询业务" />
            <asp:BoundField DataField="电话" HeaderText="电话" SortExpression="电话" />
            <asp:BoundField DataField="QQ" HeaderText="QQ" SortExpression="QQ" />
            <asp:BoundField DataField="备注" HeaderText="备注" SortExpression="备注" />
            <asp:TemplateField>
                <ItemTemplate>
                    <asp:LinkButton runat="server" Text="删除" OnClientClick="return confirm('你确认要删除这次咨询吗？');" CommandName="RemoveConsultation" CommandArgument='<%# Bind("ConsultationID")%>' ID="Remove"></asp:LinkButton>
                </ItemTemplate>
            </asp:TemplateField>
        </Columns>
    </asp:GridView>
    <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:KOONCRMDB %>"
        SelectCommand="Sheet_GetMyConsultations" SelectCommandType="StoredProcedure">
        <SelectParameters>
            <asp:ControlParameter ControlID="MyLoginName" Name="loginname" PropertyName="Value"
                Type="String" />
            <asp:ControlParameter ControlID="DelegateType" Name="delegatetype" 
                PropertyName="SelectedValue" Type="Int16" />
            <asp:ControlParameter ControlID="CustomerName" Name="name" PropertyName="Text" 
                Type="String" ConvertEmptyStringToNull="False" />
            <asp:ControlParameter ControlID="Telephone" Name="telephone" 
                PropertyName="Text" Type="String" ConvertEmptyStringToNull="False" />
        </SelectParameters>
    </asp:SqlDataSource>
    <asp:HiddenField ID="MyLoginName" runat="server" />
    </asp:Content>
